package com.jade.editor.domain.ani;

import java.util.ArrayList;

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.wb.swt.SWTResourceManager;

public class Cortege {

	private ArrayList<Point> _plist = new ArrayList<Point>();
	private Point _fstNode = null;
	private Point _lstNode = null;
	
	private RGB _color = new RGB(0,0,0);
	
	public void setColor(RGB color){
		_color = color;
	}
	
	public Cortege(){
		
	}
	
	public Cortege(ArrayList<Point> plist){
		if (plist.size() > 1){
			
			_fstNode = plist.get(0);
			_lstNode = plist.get(plist.size()-1);
			
			_plist = plist;
		}
	}
	
	
	public ArrayList<Point> getPointsList(){
		return _plist;
	}
	
	
	public void paint(GC gc){
		gc.setForeground(SWTResourceManager.getColor(_color));
		if (_fstNode != null && _lstNode != null){
			gc.drawLine(_fstNode.x, _fstNode.y, _lstNode.x, _lstNode.y);
		}
	}
	
	public void paint(GC gc, int posx, int posy){
		gc.setForeground(SWTResourceManager.getColor(_color));
		if (_fstNode != null && _lstNode != null){
			gc.drawLine(_fstNode.x + posx, _fstNode.y + posy, _lstNode.x + posx, _lstNode.y + posy);
		}
	}
}
